<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <script>
        //window对象有浏览器提供给我们使用的，无需自己去new 
        //window. 可以省略不写
        function fun1() {
            window.alert("hello")

        }

        function fun2() {
            var res = window.prompt("hello,请输入姓名")
            console.log(res);
        }

        function fun3() {
            var res = window.confirm("确定要删除吗")
            console.log(res);

        }
        function fun4(){
            window.setTimeout(function(){
                console.log("hello");
            },2000)
        }
    </script>

</head>

<body>

    <button onclick="fun1()">信息提示框</button>
    <button onclick="fun2()">信息输入框</button>
    <button onclick="fun3()">信息确认框</button>
    <button onclick="fun4()">两秒后向控制台打印hello</button>


</body>

</html>